<%--
  Created by IntelliJ IDEA.
  User: zjy
  Date: 2015/4/13
  Time: 16:37
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@include file="/context/mytags.jsp" %>
<t:base type="jquery,easyui,tools"/>
<div class="easyui-layout" fit="true" id="main_ad_list">
    <div region="center" style="padding:1px;">
        <t:datagrid name="studioList" title="" actionUrl="studioController.do?datagrid" idField="studioId" fit="true"
                    queryMode="group">
            <t:dgCol title="studioId" field="studioId" hidden="true" sortable="false"></t:dgCol>
            <t:dgCol title="工作室" field="name" query="true" width="2" sortable="false"></t:dgCol>
            <t:dgCol title="创建人" field="consultantEntity.aCustomerEntity.realname" width="1" query="true" sortable="false"></t:dgCol>
            <t:dgCol title="审核状态" field="isReview" dictionary="review" query="true" sortable="false"></t:dgCol>
            <%--<t:dgCol title="封禁" field="isAuth" dictionary="isno" query="true"></t:dgCol>--%>
            <t:dgCol title="创建时间" formatter="yyyy-MM-dd hh:mm:ss" field="createTime" width="1" sortable="false"></t:dgCol>
            <t:dgCol title="是否专家工作室" field="consultantEntity.isExpert" dictionary="isno" sortable="false"></t:dgCol>
            <t:dgCol title="排序" field="sort" sortable="false"></t:dgCol>

            <t:dgCol title="操作" field="opt" width="1"></t:dgCol>
            <t:dgOpenOpt exp="isReview#ne#11" url="studioController.do?detail&id={studioId}" title="查看"
                         width="1000"
                         height="500"></t:dgOpenOpt>
            <t:dgFunOpt funname="f_review(studioId)" title="审核" exp="isReview#eq#0"></t:dgFunOpt>
            <t:dgFunOpt funname="showPerson(studioId)" title="专家信息"></t:dgFunOpt>
            <t:dgFunOpt funname="f_sortOrder(studioId)" title="排序"></t:dgFunOpt>
            <t:dgConfOpt url="studioController.do?delStudio&id={studioId}" title="删除"
                         message="确定删除工作室？"></t:dgConfOpt>

            <%--<t:dgConfOpt url="studioController.do?forbidden&id={studioId}" exp="isAuth#eq#0" title="封禁"--%>
            <%--message="确定封禁本工作室？"></t:dgConfOpt>--%>
            <%--<t:dgConfOpt url="studioController.do?forbidden&id={studioId}" exp="isAuth#eq#1" title="解封"--%>
            <%--message="确定封禁本工作室？"></t:dgConfOpt>--%>

            <t:dgToolBar title="新增" icon="icon-add" url="studioController.do?addorupdate" funname="add"
                         width="1000"
                         height="500"></t:dgToolBar>
            <t:dgToolBar title="修改" icon="icon-edit" url="studioController.do?addorupdate" funname="f_update"
                         width="1000"
                         height="500"></t:dgToolBar>

            <%--<t:dgDelOpt url="articleController.do?delArticle&id={id}" title="删除"></t:dgDelOpt>--%>
            <%--<t:dgToolBar title="新增" icon="icon-add" url="bankController.do?addorupdateView" funname="add"  width="600" height="500"></t:dgToolBar>--%>
            <%--<t:dgToolBar title="修改" icon="icon-edit" url="bankController.do?addorupdateView" funname="f_updateBankfInfo"  width="600" height="500"></t:dgToolBar>--%>
            <%--<t:dgToolBar title="预览" langArg="common.user" icon="icon-search" url="bankController.do?bankController&id=" funname="f_openPreview"  width="850" height="600"></t:dgToolBar>--%>
            <%--<t:dgToolBar title="查看" icon="icon-search" url="sArticleController.do?addorupdate&search=search" funname="detail"  width="800" height="630"></t:dgToolBar>--%>
        </t:datagrid>
    </div>
</div>
<div data-options="region:'east',
	title:'人员信息',
	collapsed:true,
	split:true,
	border:false,
	onExpand : function(){
		li_east = 1;
	},
	onCollapse : function() {
	    li_east = 0;
	}"
     style="width: 400px; overflow: hidden;" id="eastPanel">
    <div class="easyui-panel" style="padding: 1px;" fit="true" border="false" id="adListPanel"></div>
</div>
<script type="text/javascript">
    $(function () {
        var li_east = 0;
    });
    function f_update(title, url, id, width, height) {
        gridname = id;
        var rowsData = $('#' + id).datagrid('getSelections');
        if (!rowsData || rowsData.length == 0) {
            tip('请选择编辑项');
            return;
        }
        if (rowsData.length > 1) {
            tip('请选择一条记录再编辑');
            return;
        }
        url += '&studioId=' + rowsData[0].studioId;

        createwindow(title, url, width, height);
    }

    function f_sortOrder(studioId) {
        var title = "排序";
        var width = 300;
        var height = 100;
        var url = "studioController.do?sortOrder&id=" + studioId;
        createwindow(title, url, width, height);
    }

    function f_review(studioId) {
        var title = "排序";
        var width = 300;
        var height = 100;
        var url = "studioController.do?review&id=" + studioId;
        createwindow(title, url, width, height);
    }

    function showPerson(id) {
        var title = '专家信息';
        if (li_east == 0) {
            $('#main_ad_list').layout('expand', 'east');
        }
        $('#main_ad_list').layout('panel', 'east').panel('setTitle', title);
        $('#main_ad_list').layout('panel', 'east').panel('resize', {width: 600});
        $('#adListPanel').panel("refresh", "consultantController.do?stuPersonManager&id=" + id);

    }
</script>
